import useUserStore from "@/store/modules/user.js";

export const modulePerm = (value) => {
    const permissionList = useUserStore().permissionList
    const permissions = permissionList.map(item => item.action)
    if(value && value instanceof Array && value.length > 0){
        //判断两个数组是否有相同项
        const hasPermissions = value.some(permission => {
            return permissions.includes(permission)
        })
        if (!hasPermissions) {
            return false
        }else{
            return true
        }
    }
}
